public class Test015 {
    public static void main(String[] args) {
        System.out.println(fac(6));
    }
    public static int fac(int n){
        int count = 0;
        while(n !=0){
                count++;
                n=n & (n-1);
            }
        return count;
    }
}
